Repository navigation
kit-201-tests-isolated-on-box: Kit tests run on a devteam box or in a worker can't reach the real fleet: no DEVTEAM_* env leaks into test children, and onBox() can be turned off - #239
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The box detection (onBox, threadsNeedGateway, gatewayThreadKey) is marked as a block and loaded by test/lib/kit.mjs's boxFns on a machine of the test's making, so the limit is tested in CI where no box file exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test/lib/kit.mjs deletes every DEVTEAM_* but the harness's own knobs (HARNESS_ENV), and TMUX/TMUX_PANE, at import, and sets DEVTEAM_BOX=off; the per-file denylists go, gateway.test.mjs imports the helper, hub-overview's kit gets a temp HOME. A decoy test runs the incident's own test under a worker's env and finds nothing written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gn DEVTEAM_RUN) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ested-kit rulings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ested in another repo A DEVTEAM_RUN whose real path isn't the default run folder's or inside mainRoot dies naming both paths (help and the machine-wide commands exempt); a kit copied into a folder of another checkout with no .git of its own dies instead of taking that checkout's home. bareProject asserts each fixture is a repo of its own. The decoy test is the supervisor's exact reproduction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Task 3 review fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hhff
marked this pull request as ready for review
November 14, 2026 23:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Kit tests run on a devteam box or inside a worker can no longer reach the real fleet (incident p-20261114-214815998-supervisor: a kit test run from kit-46's worktree wrote ~25 lines into home's live log).
What changes
test/lib/kit.mjs): at import, everyDEVTEAM_*but the harness's own knobs (HARNESS_ENV:DEVTEAM_TEST_*,FORK,FORK_AUDIT,G1_RECORD,CGROUP,MEMINFO) andTMUX/TMUX_PANEare deleted, thenDEVTEAM_BOX=offis set. The per-file denylists in machine, operator-threads, hub-overview and gateway tests go; gateway.test.mjs imports the helper; hub-overview's kit gets a tempHOME.DEVTEAM_BOX=off(devteam.mjs, box detection): the kit ignores the box's files (/opt/devteam/gateway.mjs,/etc/devteam/thread-key.pub) only whileHOME, by real path, isn't the account's passwd home; anything unresolvable leaves the files on. Box detection is a marked block, loaded in a vm byboxFns()and tested in CI.DEVTEAM_RUNwhose real path isn't the default run folder's or inside the resolved home (mainRoot) dies naming both paths, for every command buthelpand the machine-wide ones.docs/devteam(by the real path ofgit rev-parse --show-toplevel, asked without the caller'sGIT_DIR) dies before the re-exec instead of taking that checkout's home;bareProjectasserts each fixture is a repo of its own.How to verify
docs/devteam-dev/tickets/kit-201-tests-isolated-on-box/verification.md: a row per done-when, with commands and results.env -u DEVTEAM_HOME DEVTEAM_ROLE=worker DEVTEAM_RUN=<decoy> node --test --test-name-pattern 'status says at a glance' test/machine.test.mjsfrom the kit's checkout writes the owner rule into<decoy>/log/owner-2026-11.jsonlat main, and nothing after this change (it is now a test in machine.test.mjs).Not defended: an agent that sets HOME to a temp folder on purpose (and copies the store there) gets the laptop's unsigned behaviour, for operator threads in that copy and for pane answers into the real project's log and pane (P6). Nor a DEVTEAM_RUN set on purpose to some other folder inside home.
Note:
test/lib/ports.mjs:22still says the gateway test claims no port block; it now claims one throughlib/kit.mjs(ports.mjs is outside this ticket's touches).One-way doors
None.
🤖 Generated with Claude Code